function MADGetMADDriverPtr: MADDriverRecPtr; { Get MADDriver structure pointer. }
C; EXTERNAL;
function MADInitLibrary(PlugsFolderName: CStringPtr; SysMemory: Boolean): OSErr; { Library initialisation, you have to CALL this function if you want to use other functions & variables }
C; EXTERNAL;
function MADDisposeLibrary: OSErr; { Close Library, close music, close driver, free all memory }
C; EXTERNAL;
procedure MADGetBestDriver(DriverInitParam: MADDriverSettingsPtr); { Found and identify the current Mac sound hardware and fill DriverInitParam }
C; EXTERNAL;
function MADCreateDriver(DriverInitParam: MADDriverSettingsPtr): OSErr; { Music Driver initialization and memory allocation }
C; EXTERNAL;
function MADDisposeDriver: OSErr; { Dispose the music driver, use it after RInitMusic() }
C; EXTERNAL;
function MADStartDriver: OSErr; { NEW - Activate the sound generating procedure (interruption) }
C; EXTERNAL;
function MADStopDriver: OSErr; { NEW - DESActivate the sound generating procedure (interruption) }
C; EXTERNAL;
function MADPlayMusic: OSErr; { NEW - Read and play current music in memory - Call MADStartInterruption BEFORE }
C; EXTERNAL;
function MADStopMusic: OSErr; { NEW - Stop reading current music in memory }
C; EXTERNAL;
function MADReset: OSErr; { Reset the current music at the start position }
C; EXTERNAL;
function MADGetMusicStatus(var fullTime, curTime: LongInt): OSErr; { Get informations about music position and duration }
C; EXTERNAL;
function MADSetHardwareVolume(theVol: LongInt): OSErr; { 0...64, Mac HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume }
C; EXTERNAL;
function MADGetHardwareVolume: LongInt; { Return HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume }
C; EXTERNAL;
function MADLoadMusicRsrc(IDName: MADResType; IDNo: Integer): OSErr; { Load a MAD Rsrc into memory }
C; EXTERNAL;
function MADLoadMusicPtr(myPtr: Ptr): OSErr; { Load a MAD Ptr into memory, you can DisposPtr your Ptr after this call }
C; EXTERNAL;
function MADLoadMusicPartition(aPartition: MADPartitionPtr): OSErr; { Load a MAD partition into memory }
C; EXTERNAL;
function MADLoadMusicFilePString(plugType: MADPlugTypePtr; fName: Str255): OSErr; { Load a music file with plug }
C; EXTERNAL;
function MADLoadMusicFileCString(plugType: MADPlugTypePtr; fName: CStringPtr): OSErr; { Load a music file with plug }
C; EXTERNAL;
function MADLoadMusicFSpFile(plugType: MADPlugTypePtr; theSpec: FSSpecPtr): OSErr; { Load a music file with plug }
C; EXTERNAL;
function MADMusicIdentifyPString(plugType: MADPlugTypePtr; pName: Str255): OSErr; { Identify what kind of music format is pName file. }
C; EXTERNAL;
function MADMusicIdentifyCString(plugType: MADPlugTypePtr; cName: CStringPtr): OSErr; { Identify what kind of music format is cName file. }
C; EXTERNAL;
function MADMusicIdentifyFSp(plugType: MADPlugTypePtr; theSpec: FSSpecPtr): OSErr; { Same as above but with a FSSpec pointer }
C; EXTERNAL;
function MADPlugAvailable(plugType: MADPlugTypePtr): Boolean; { Is plug 'plugType' available? }
C; EXTERNAL;
function MADDisposeMusic: OSErr; { Dispose the current music }
C; EXTERNAL;
procedure MADChangeTracks(i: Integer); { Change current tracks number of the music driver }
C; EXTERNAL;
procedure MADCleanDriver(intDriver: MADDriverRecPtr); { Clean the driver : stop playing sounds }
C; EXTERNAL;
function GetMADCommand( position: Integer; { Extract a Command from a PatData structure }
channel: Integer;
aPatData: PatDataPtr): CmdPtr;
C; EXTERNAL;
function MADPlaySndHandle(sound: Handle; { Handle to a 'snd ' handle, by ex: GetResource('snd ', 128); }
chan: LongInt; { channel ID on which to play sound }
note: LongInt): OSErr; { note: 0 to NUMBER_NOTES or 0xFF: play sound at his normal sampleRate Khz }
C; EXTERNAL;
function MADPlaySoundData(soundPtr: Ptr; { Sound Pointer to data }
size: LongInt; { Sound size in bytes }
channel: LongInt; { channel ID on which to play sound }
note: LongInt; { note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz }
amplitude: LongInt; { 8 or 16 bits }
loopBeg: LongInt; { loop beginning }
loopSize: LongInt; { loop size in bytes }
rate: UnsignedLong): OSErr; { sample rate of the sound data, by ex: rate22khz }
C; EXTERNAL;
function MADPlaySoundDataSYNC(soundPtr: Ptr; { Sound Pointer to data }
size: LongInt; { Sound size in bytes }
channel: LongInt; { channel ID on which to play sound }
note: LongInt; { note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz }
amplitude: LongInt; { 8 or 16 bits }
loopBeg: LongInt; { loop beginning }
loopSize: LongInt; { loop size in bytes }
rate: UnsignedLong): OSErr;{ sample rate of the sound data, by ex: rate22khz }
C; EXTERNAL;
procedure OSType2MADPlugType(theType: OSType; var thePlug: MADPlugType);
implementation
{ Used to convert from OSType (4 bytes) to MADPlugType (5 bytes) }
procedure OSType2MADPlugType(theType: OSType; var thePlug: MADPlugType);